'use strict'
const staff = {
  state: {
    // 人事
    staffManagment: []
  },
  mutations: {
    SET_STAFF: (state, newstaffManagment) => {
      state.staffManagment.push(newstaffManagment[0])
      console.log('人事添加新信息为:', state.staffManagment)
    }
  },
  // Action 通过 store.dispatch 方法触发
  actions: {
    // newstaffManagment为自己的传参
    setstaff ({ dispatch, commit, state }, newstaffManagment) {
      console.log('人事添加入参：', newstaffManagment)
      commit('SET_STAFF', newstaffManagment)
    }
  }
}
export default staff
